package com.ssww.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ssww.dao.ProductDao;
import com.ssww.entity.Product;
import com.ssww.service.ProductService;
/**
 * 
 * @author 
 *
 */
@Service
public class ProductServiceImpl implements  ProductService {
	@Resource
	private ProductDao ProductDao;
	
	@Transactional
	public Product getProductById(Integer id) {
		return ProductDao.getProductById(id);
	}
	@Transactional
	public List<Product> getProductList() {
		return ProductDao.getProductList();
	}
	@Transactional
	public int addProduct(Product a) {
		ProductDao.addProduct(a);
		return 0;
	}
	@Transactional
	public int deleteProduct(int id) {
		ProductDao.deleteProduct(id);
		return 0;
	}
	@Transactional
	public int updateProduct(Product a, int id) {
		ProductDao.updateProduct(a, id);
		return 0;
	}
}
